using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace Musicman.Client
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            
            LoadingForm lf = new LoadingForm();
            lf.Show();
            MusicmanClient2 mc2 = new MusicmanClient2();
            AuthenticationService.AuthenticationService aService = new Musicman.Client.AuthenticationService.AuthenticationService();
            AuthenticationService.AuthHeader aHeader = new Musicman.Client.AuthenticationService.AuthHeader();
            LoginForm loginForm = new LoginForm(aService, aHeader);
            if (loginForm.ShowDialog() == DialogResult.Cancel)
            {
                mc2.Close();
            }
            else
            {
                mc2.loginForm = loginForm;
                mc2.aService = aService;
                mc2.aHeader = aHeader;
                mc2.InitializeMe();
                lf.Close();
                mc2.ShowInTaskbar = true;
                mc2.WindowState = FormWindowState.Normal;
                Application.Run(mc2);
            }
        }
    }
}